package com.sjb.cp.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sjb.cp.model.po.Picture;
import com.sjb.cp.model.po.Space;
import com.sjb.cp.model.po.User;
import com.sjb.cp.model.request.space.SpaceAddRequest;
import com.sjb.cp.model.request.space.SpaceQueryRequest;
import com.sjb.cp.model.vo.SpaceVO;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author:sjb
 * @CreateTime:2025-01-26
 * @Description: 空间基础服务
 * @Version：1.0
 */
public interface SpaceService extends IService<Space> {

    /**
     * 校验空间参数
     * @param add
     * @param space
     */
    void validateSpace(boolean add, Space space);

    /**
     * 根据空间级别填充空间限额
     * @param space
     */
    void fillSpaceBySpaceLevel(Space space);

    /**
     * 用户创建空间
     * @param spaceAddRequest
     * @param loginUser
     * @return
     */
    long addSpace(SpaceAddRequest spaceAddRequest, User loginUser);

    /**
     * 基础查询
     * @param spaceQueryRequest
     * @return
     */
    QueryWrapper<Space> getQueryWrapper(SpaceQueryRequest spaceQueryRequest);

    /**
     * 获取spaceVo视图
     * @param space
     * @param request
     * @return
     */
    SpaceVO getSpaceVo(Space space, HttpServletRequest request);

}
